////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//																											  //
//	Note: Please do not make HeavyBid specific changes here. Always create a subclass to do whatever you want //
//	because this is a generic file that is used in multiple products.										  //
//																											  //
//	Personal thanks from Frank Cheng																		  //
//																											  //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//FWC 03/19/2007 (5102) Moved HCSS based subclassing to HCSS_HyperLink.cls
//MAS 01/31/2007 (6665) Augmented procedure Help in FCP_Hyperlink to send help to its parent object (if it exists).
//FWC 01/30/2007 (6616) Pressing enter cause the hyperlink to jump to the next focusable object and THEN the enter. Yucks.
//MAS 01/27/2007 (6665) Added one line of code for when user presses Enter while on a link.
//MAS 01/25/2007 (6665) Use passmixn.cls for hyperlink.
//FWC 12/27/2006 (6616) Added way to change background color of a hyperlink control
//FWC 06/15/2006 (6414) Be able to show tooltip on Grid Header.

Use DfAllEnt.pkg
External_Function AnimateBPO "AnimateBPO" HCSSAPI.DLL Integer i1 Integer i2 Integer i3 Returns Integer
External_Function DLL_Initialize "DLL_Initialize" HCSSAPI.DLL Integer iVoid returns Integer
External_Function DragDrop_DoDragDrop "DragDrop_DoDragDrop" HCSSAPI.DLL Integer i1 Returns Integer
External_Function BusinessProcess_Initialize "BusinessProcess_Initialize" HCSSAPI.DLL Integer i1 Integer i2 Integer i3 Returns Integer
External_Function FontEnumerate "FontEnumerate" HCSSAPI.DLL Returns Integer
External_Function FontEnumerateFree "FontEnumerateFree" HCSSAPI.DLL Integer iHandle Returns Integer
External_Function HeaderDragDrop "HeaderDragDrop" HCSSAPI.DLL Integer iHandle Integer iTrue Returns Integer
External_Function ChainWait "ChainWait" HCSSAPI.DLL Handle hWnd String sProgram String sParameters Returns Integer
External_Function InitCommonControlsEx "InitCommonControlsEx" ComCtl32.dll Handle hStruct Returns Integer
External_Function NoDot_Initialize "NoDot_Initialize" HCSSAPI.DLL Integer i1 Integer i2 Returns Integer
External_Function GetLocalTime "GetLocalTime" Kernel32.dll Integer i1 Returns Integer
External_Function UppercaseKey "UppercaseKey" HCSSAPI.DLL Integer i1 Returns Integer //FWC 05/05/2005
External_Function MessageBoxEx2 "MessageBoxEx2" HCSSAPI.dll Handle hWnd String sContent String sCaption Integer iOptions Returns Integer //FWC 11/2/2005
External_Function GridToolTip "GridToolTip" HCSSAPI.DLL Integer i1 Returns Integer //FWC 06/15/2006

Type FCP_BPOInfo
	Field FCP_BPOInfo.cbSize		as Integer
	Field FCP_BPOInfo.piMaximum 	as Integer
	Field FCP_BPOInfo.piMinimum 	as Integer
	Field FCP_BPOInfo.piAdvanceBy	as Integer
	Field FCP_BPOInfo.piPosition	as Integer
	Field FCP_BPOInfo.pbHistoryMode as Integer
	Field FCP_BPOInfo.pbProgressbar as Integer
	Field FCP_BPOInfo.pbCancelMode	as Integer
	Field FCP_BPOInfo.pbButtonMode	as Integer
	Field FCP_BPOInfo.pbButtonEnabled	as Integer
	Field FCP_BPOInfo.lpszMessage		as Integer
	Field FCP_BPOInfo.lpszCaption		as Integer
	Field FCP_BPOInfo.lpszTitle 		as Integer
	Field FCP_BPOInfo.lpszButtonText	as Integer
End_Type // FCP_BPOInfo

Type FCP_WinMessageInfo
	Field FCP_WinMessageInfo.hObj	as Integer
	Field FCP_WinMessageInfo.wParam as Integer
	Field FCP_WinMessageInfo.lParam as Integer
End_Type // FCP_WinMessageInfo

Type TWOTIME
	Field TwoTime.f1 as Integer
	Field TwoTime.f2 as Integer
	Field TwoTime.f3 as Integer
	Field TwoTime.f4 as Integer
End_Type // TWOTIME

Type TYPE_INITCCEX
	Field TYPE_INITCCEX.dwSize as Integer
	Field TYPE_INITCCEX.dwICC as Integer
End_Type // TYPE_INITCCEX

Type DTSelChange
	Field DTSelchange.f1 as Integer
	Field DTSelchange.f2 as Integer
	Field DTSelchange.f3 as Integer
	Field DTSelchange.f4 as Integer
End_Type // DTSelChange

Define ICC_DATE_CLASSES  for (|CI$100)
Define WM_ADDMESSAGE For (WM_USER+400)
Define WM_RECEIVEMESSAGE For (WM_USER+401)

Procedure HCSSAPI_Initialize
	Integer ivoid
	Move (DLL_Initialize()) to ivoid
End_Procedure // HCSSAPI_Initialize

Send HCSSAPI_Initialize

#IFDEF GET_SHELLEXECUTE
#ELSE
External_Function ShellExecute "ShellExecuteA" Shell32.Dll ;
	Handle hwnd ;
	String sOperation ;
	String sFile ;
	String sParameters ;
	String sDirectory ;
	Integer nShowCmd ;
	Returns Integer
#ENDIF

//MAS 03/07/06	cWinMessage moved here (was farther down the file).
Class cWinMessage is a cWinControl
	Procedure WmReceiveMessage Integer wParam Integer lParam
		String s__WinMessage
		Handle h__WinMessage
		Integer iVoid iwParam ilParam iObject
		ZeroType FCP_WinMessageInfo To s__WinMessage
		GetAddress of s__WinMessage To h__WinMessage
		Move (CopyMemory(h__WinMessage, lParam, FCP_WinMessageInfo_Size)) To iVoid
		GetBuff From s__WinMessage at FCP_WinMessageInfo.wParam to iwParam
		GetBuff From s__WinMessage at FCP_WinMessageInfo.lParam to ilParam
		GetBuff From s__WinMessage at FCP_WinMessageInfo.hObj to iObject
		Send wParam of iObject iwParam ilParam
	End_Procedure // WmReceiveMessage
	Procedure Construct_Object
		Set External_Class_Name 'DFWinMessage' to 'WinMessage'
		Forward Send Construct_Object
		Set Focus_Mode to NONFOCUSABLE
		Set External_Message WM_RECEIVEMESSAGE to msg_WmReceiveMessage
		Set Size to 0 0
		Set Location to 0 0
		Set Visible_State to FALSE
		Set Skip_State to TRUE
	End_Procedure // Construct_Object
	Procedure External_Windows_Message Integer iObject Integer iWinMessage Integer iDFMessage
		String s__WinMessage
		Handle h__WinMessage hWnd
		ZeroType FCP_WinMessageInfo To s__WinMessage
		GetAddress of s__WinMessage To h__WinMessage
		Put iWinMessage to s__WinMessage at FCP_WinMessageInfo.wParam
		Put iDFMessage to s__WinMessage at FCP_WinMessageInfo.lParam
		Put iObject to s__WinMessage at FCP_WinMessageInfo.hObj
		Get Window_Handle of iObject to hWnd
		Send Windows_Message WM_ADDMESSAGE hWnd h__WinMessage
	End_Procedure // External_Windows_Message
	Procedure Register_Windows_Message
	End_Procedure // Register_Windows_Message
	Procedure Page Integer iState
		Forward Send Page iState
		if (iState=1) Send Register_Windows_Message
	End_Procedure // Page
	function ContainerFocusWillNotChange returns integer //FWC 03/12/2004
		function_return 1
	end_function // ContainerFocusWillNotChange
	Procedure Rotate_Up //FWC 03/12/2004
	End_Procedure // Rotate_Up
	Procedure docreateanchors //FWC 03/12/2004
	End_procedure // docreateanchors
	Procedure doapplyanchors //FWC 03/12/2004
	End_procedure // doapplyanchors
End_Class // cWinMessage

//FWC 03/19/2007 Register_Object ResizeTimer					  //MAS 01/29/06
//FWC 03/19/2007 //Register_Procedure Define_Resize_Mixin					   //MAS 01/29/06
//FWC 03/19/2007 Use dfgsini.pkg //MAS 01/31/06
//FWC 03/19/2007 Register_Object ResizeTimer						 //MAS 05/05/03
//FWC 03/19/2007 Register_Procedure InitializeTimer 					   //MAS 05/05/03
//FWC 03/19/2007 Register_Procedure LoadLocation Integer iStoredLoc 	   //MAS 01/31/06
//FWC 03/19/2007 Register_Procedure Set Timer_Active_State Integer iState  //MAS 01/31/06
//FWC 03/19/2007 Register_Function Timer_Active_State Returns Integer	   //MAS 01/31/06
//FWC 03/19/2007 Register_Procedure Set InitialGuiSize Integer iSize	   //MAS 01/31/06
//FWC 03/19/2007 Register_Function InitialGuisize Returns Integer		   //MAS 01/31/06
//FWC 03/19/2007 Register_Procedure Refresh_Current_Page				   //MAS 01/31/06
//FWC 03/19/2007 Use Splitter.cls										   //MAS 01/31/06
//FWC 03/19/2007 Use ResizeMx.Cls										   //MAS 01/31/06
//FWC 03/19/2007 Declare_datafile UserGrp									   //MAS 01/25/2007
//FWC 03/19/2007 Register_Function fFind_Usergrp String sGroup Returns Integer //MAS 01/25/2007
//FWC 03/19/2007 Use Passmixn.cls																							//MAS 01/25/2007

Define HLM_SETBKCOLOR For (WM_USER+101) //FWC 12/27/2006

Class FCP_BaseHyperLink is a DFControl //FWC 03/19/2007 FCP_HyperLink

	Procedure Construct_Object
		Forward Send Construct_Object
		Property Integer piPrivate.Color clBtnFace //FWC 12/27/2006
		Set External_Class_Name 'FCP_HyperLink' To 'HCSSHyperLink'
		//FWC 03/19/2007 Send Define_Resize_Mixin  //MAS 01/29/06
		//FWC 03/19/2007 Send Define_Password_Mixin //MAS 01/25/2007
	End_Procedure // Construct_Object

	//FWC 03/19/2007 Import_Class_Protocol Resize_Mixin
	//FWC 03/19/2007 Import_Class_Protocol Password_Mixin	   //MAS 01/25/2007

	Procedure Set Color Integer iColor //FWC 12/27/2006
		If (Window_Handle(Self)) Send Windows_Message HLM_SETBKCOLOR 0 iColor
		Set piPrivate.Color to iColor
	End_Procedure // Color

	Procedure Page_Object Integer iPage //FWC 12/27/2006
		Forward Send Page_Object iPage
		If (iPage And piPrivate.Color(Self)<>clBtnFace) Set Color to (piPrivate.Color(Self))
	End_Procedure // Page_Object

	Procedure Set Label String sValue
		Set Value 0 to sValue
	End_Procedure // Label

	Function Label Returns String
		Function_Return (Value(Self,0))
	End_Function // Label

	Procedure OnClick
	End_Procedure // OnClick

	Procedure OnRClick
	End_Procedure // OnRClick

	Procedure Command Integer wParam Integer lParam
		If (Hi(wParam)) Send OnRClick
		Else Send OnClick
	End_Procedure // Command

	Procedure Default_Action //FWC 01/30/2007
		Send OnClick
	End_Procedure // Default_Action

	//FWC 03/19/2007 Procedure Help 				 //MAS 01/31/2007
	//FWC 03/19/2007	If (Parent(Self)) Send Help to (Parent(Self))
	//FWC 03/19/2007 End_Procedure // Help
	//FWC 01/30/2007 On_Key kEnter Send OnClick 		  //MAS 01/27/2007
End_Class // FCP_HyperLink

Class cFCPAnimateBPO is a Message
	Procedure Construct_Object
		Forward Send Construct_Object
		Property Handle Window_Handle 0
		Property String psProcessTitle ""
	End_Procedure // Construct_Object
	Procedure Set Process_Title String sTitle
		Integer iVoid
		Handle hWnd
		Get Window_Handle to hWnd
		Set psProcessTitle to sTitle
		If (hWnd) Move (AnimateBPO(hWnd,726,AddressOf(sTitle))) to iVoid
	End_Procedure // Process_Title
	Function Process_Title Returns String
		Function_Return (psProcessTitle(Self))
	End_Function // Process_Title
	Procedure Update_Status String sStatus
		Integer iVoid
		Handle hWnd
		Get Window_Handle to hWnd
		If (Hwnd) Move (AnimateBPO(hWnd,725,AddressOf(sStatus))) to iVoid
	End_Procedure // Update_Status
	Procedure Start_Status
		Handle hWnd
		String sProcessTitle
		Get Window_Handle to hWnd
		If (hWnd=0) Begin
			Get Process_Title to sProcessTitle
			Move (AnimateBPO(0,723,AddressOf(sProcessTitle))) to hWnd
			Set Window_Handle to hWnd
		End
	End_Procedure // Start_Status
	Procedure End_Status
		Integer iVoid
		Handle hWnd
		Get Window_Handle to hWnd
		If (hWnd) Begin
			Move (AnimateBPO(hWnd,724,0)) to iVoid
			Set Window_Handle to 0
		End
	End_Procedure // End_Status
End_Class // cFCPAnimateBPO

Class FCP_BusinessProcess is a BusinessProcess
	Procedure Construct_Object
		Forward Send Construct_Object
		Property Integer piPrivateMaximum 100
		Property Integer piMinimum 0
		Property Integer piAdvanceBy 10
		Property Integer piPrivatePosition 0
		Property Boolean pbResetPosition TRUE
		Property Boolean pbHistoryMode FALSE
		Property Boolean pbProgressbar FALSE
		Property Boolean pbButtonMode  FALSE
		Property Boolean pbPrivateButtonEnabled TRUE
		Property Handle Window_Handle 0
		Property String psPrivateProcessMessage ""
		Property String psButtonText ""
	End_Procedure // Construct_Object

	Procedure Set pbButtonEnabled Boolean bEnable
		Integer iVoid
		Set pbPrivateButtonEnabled to bEnable
		If (Window_Handle(Self)) Move (BusinessProcess_Initialize(731,bEnable,Window_Handle(Self))) to iVoid
	End_Procedure // pbButtonEnabled

	Function pbButtonEnabled Returns Boolean
		Function_Return (pbPrivateButtonEnabled(Self))
	End_Function // pbButtonEnabled

	Procedure Set piMaximum Integer iMax
		Integer iVoid
		Set piPrivateMaximum to iMax
		If (Window_Handle(Self)) Move (BusinessProcess_Initialize(730,iMax,Window_Handle(Self))) to iVoid
	End_Procedure // piMaximum

	Function piMaximum Returns Integer
		Function_Return (piPrivateMaximum(Self))
	End_Function // piMaximum



	Procedure Set piPosition Integer iPos
		Integer iVoid
		Set piPrivatePosition to iPos
		If (Window_Handle(Self)) Move (BusinessProcess_Initialize(722,iPos,Window_Handle(Self))) to iVoid
	End_Procedure // piPosition

	Function piPosition Returns Integer
		Function_Return (piPrivatePosition(Self))
	End_Function // piPosition

	Procedure Set Process_Message String sMsg
		Handle hMsg
		Integer iVoid
		Set psPrivateProcessMessage to sMsg
		If (Window_Handle(Self)) Begin
			GetAddress Of sMsg to hMsg
			Move (BusinessProcess_Initialize(721,hMsg,Window_Handle(Self))) to iVoid
		End
	End_Procedure // Process_Message

	Function Process_Message Returns String
		Function_Return (psPrivateProcessMessage(Self))
	End_Function // Process_Message

	Procedure DoAdvance
		Set piPosition to (piPosition(Self)+piAdvanceBy(Self))
	End_Procedure // DoAdvance

	Function Cancel_Check Returns Integer
		Integer StopIt iCancel
		Move (BusinessProcess_Initialize(724,0,Window_Handle(Self))) to iCancel
		If (Error_Check_State(self) OR iCancel) Begin
			Send End_Status
			Get Process_Interrupt to StopIt
			If Not StopIt Send Resume_Status
			Set Error_Check_State to False
		End
		Function_Return StopIt
	End_Function // Cancel_Check

	Function Button_Check Returns Integer
		Integer iClick
		Handle hWnd
		Get Window_Handle to hWnd
		If (hWnd) Move (BusinessProcess_Initialize(732,0,hWnd)) to iClick
		Else Move 0 to iClick
		Function_Return iClick
	End_Function // Button_Check

	Procedure End_Status
		Integer iVoid
		If (Window_Handle(Self)) Begin
			Move (BusinessProcess_Initialize(725,0,Window_Handle(Self))) to iVoid
			Set Window_Handle to 0
		End
	End_Procedure // End_Status
	Procedure Start_Status
		Integer iVoid
		String sProcessTitle sProcessMessage sProcessCaption sInfo sButtonText
		Handle hProcessTitle hProcessMessage hProcessCaption hInfo hButtonText
		Set Error_Check_State to False
		If (Status_Panel_State(Self) And Window_Handle(Self)=0) Begin
			If (pbResetPosition(Self)) Set piPosition to (piMinimum(Self))
			Get Process_Title to sProcessTitle
			Get Process_Message to sProcessMessage
			Get Process_Caption to sProcessCaption
			Get psButtonText to sButtonText
			ZeroType FCP_BPOInfo To sInfo
			Put FCP_BPOInfo_Size to sInfo at FCP_BPOInfo.cbSize
			Put (piMaximum(Self)) to sInfo at FCP_BPOInfo.piMaximum
			Put (piMinimum(Self)) to sInfo at FCP_BPOInfo.piMinimum
			Put (piAdvanceBy(Self)) to sInfo at FCP_BPOInfo.piAdvanceBy
			Put (piPosition(Self)) to sInfo at FCP_BPOInfo.piPosition
			Put (pbHistoryMode(Self)) to sInfo at FCP_BPOInfo.pbHistoryMode
			Put (pbProgressbar(Self)) to sInfo at FCP_BPOInfo.pbProgressbar
			Put (pbButtonMode(Self)) to sInfo at FCP_BPOInfo.pbButtonMode
			Put (pbButtonEnabled(Self)) to sInfo at FCP_BPOInfo.pbButtonEnabled
			Put (Allow_Cancel_State(Self)) to sInfo at FCP_BPOInfo.pbCancelMode
			GetAddress Of sProcessTitle to hProcessTitle
			GetAddress Of sProcessCaption to hProcessCaption
			GetAddress Of sProcessMessage to hProcessMessage
			GetAddress Of sButtonText to hButtonText
			Put hProcessMessage to sInfo at FCP_BPOInfo.lpszMessage
			Put hProcessCaption to sInfo at FCP_BPOInfo.lpszCaption
			Put hProcessTitle to sInfo at FCP_BPOInfo.lpszTitle
			Put hButtonText to sInfo at FCP_BPOInfo.lpszButtonText
			GetAddress Of sInfo to hInfo
			Move (BusinessProcess_Initialize(726,hInfo,0)) to iVoid
			Set Window_Handle to iVoid
		End
	End_Procedure // Start_Status
	Procedure Resume_Status
		Boolean bReset
		Get pbResetPosition to bReset
		Set pbResetPosition to FALSE
		Send Start_Status
		Set pbResetPosition to bReset
	End_Procedure // Resume_Status
	Procedure Update_Status String sMsg
		Integer iVoid hMsg
		GetAddress Of sMsg to hMsg
		Move (BusinessProcess_Initialize(727,hMsg,Window_Handle(Self))) to iVoid
	End_Procedure // Update_Status
	Procedure Reset_History
		Integer iVoid
		Move (BusinessProcess_Initialize(728,0,Window_Handle(Self))) to iVoid
	End_Procedure // Reset_History
	Procedure Update_History String sMsg
		Integer iVoid hMsg
		GetAddress Of sMsg to hMsg
		Move (BusinessProcess_Initialize(729,hMsg,Window_Handle(Self))) to iVoid
	End_Procedure // Update_History
End_Class // FCP_BusinessProcess

Class FCP_TimeForm is a Form

	Procedure Construct_Object
		String sCC
		Integer iReturn
		ZeroType TYPE_INITCCEX to sCC
		Put TYPE_INITCCEX_SIZE to sCC at TYPE_INITCCEX.dwSize
		Put ICC_DATE_CLASSES to sCC at TYPE_INITCCEX.dwICC
		Move (InitCommonControlsEx(AddressOf(sCC))) to iReturn
		Set Window_Style to 11 TRUE
		Forward Send Construct_Object
		Set External_Class_Name 'HCSSTimeForm' to 'SysDateTimePick32'
		Set Border_Style to Border_ClientEdge
		Property Integer privateTime -1
	End_Procedure // Construct_Object

	Function Value Integer iItem Returns Integer
		Integer iTime iVoid
		String sft
		If (Window_Handle(Self)) Begin
			ZeroType TwoTime to sft
			Get Windows_Message |CI$1001 0 (AddressOf(sFT)) to iVoid
			If (iVoid) Move -1 to iTime
			Else GetBuff From sft at TwoTime.f3 to iTime
			Set PrivateTime to iTime
		End
		Else Get PrivateTime to iTime
		Function_Return iTime
	End_Function // Value

	Procedure Set Value Integer iItem Integer iTime
		String sft
		Integer iVoid
		If (Window_Handle(Self)) Begin
			ZeroType TwoTime to sft
			Move (GetLocalTime(AddressOf(sFT))) to iVoid
			Put iTime to sFT at TwoTime.f3
			Send Windows_Message |CI$1002 (If(iTime=-1,1,0)) (AddressOf(sFT))
		End
		Set PrivateTime to iTime
	End_Procedure // Value

	Procedure OnChange
	End_Procedure // OnChange

	Procedure Page Integer iState
		String s
		Integer iTime
		Forward Send Page iState
		If (iState) Begin
			Move "H:mm" to s
			Send Windows_Message |CI$1005 0 (AddressOf(s))
			Get PrivateTime to iTime
			Set Value 0 to iTime
		End
	End_Procedure // Page

	Procedure Notify Integer wParam Integer lParam
		Integer iVoid iCode
		String sDT
		ZeroType DTSelchange to sDT
		Move (CopyMemory(AddressOf(sDT),lParam,DTSelchange_Size)) to iVoid
		GetBuff From sDT at DTSelchange.f3 to iCode
		if (iCode=-759) Begin
			Get Value 0 to iVoid
			Send OnChange
		End
	End_Procedure // Notify

End_Class // FCP_TimeForm

//Class cWinMessage is a cWinControl
//	Procedure WmReceiveMessage Integer wParam Integer lParam
//	  String s__WinMessage
//	  Handle h__WinMessage
//	  Integer iVoid iwParam ilParam iObject
//	  ZeroType FCP_WinMessageInfo To s__WinMessage
//	  GetAddress of s__WinMessage To h__WinMessage
//	  Move (CopyMemory(h__WinMessage, lParam, FCP_WinMessageInfo_Size)) To iVoid
//	  GetBuff From s__WinMessage at FCP_WinMessageInfo.wParam to iwParam
//	  GetBuff From s__WinMessage at FCP_WinMessageInfo.lParam to ilParam
//	  GetBuff From s__WinMessage at FCP_WinMessageInfo.hObj to iObject
//	  Send wParam of iObject iwParam ilParam
//	End_Procedure // WmReceiveMessage
//	Procedure Construct_Object
//	  Set External_Class_Name 'DFWinMessage' to 'WinMessage'
//	  Forward Send Construct_Object
//	  Set Focus_Mode to NONFOCUSABLE
//	  Set External_Message WM_RECEIVEMESSAGE to msg_WmReceiveMessage
//	  Set Size to 0 0
//	  Set Location to 0 0
//	  Set Visible_State to FALSE
//	  Set Skip_State to TRUE
//	End_Procedure // Construct_Object
//	Procedure External_Windows_Message Integer iObject Integer iWinMessage Integer iDFMessage
//	  String s__WinMessage
//	  Handle h__WinMessage hWnd
//	  ZeroType FCP_WinMessageInfo To s__WinMessage
//	  GetAddress of s__WinMessage To h__WinMessage
//	  Put iWinMessage to s__WinMessage at FCP_WinMessageInfo.wParam
//	  Put iDFMessage to s__WinMessage at FCP_WinMessageInfo.lParam
//	  Put iObject to s__WinMessage at FCP_WinMessageInfo.hObj
//	  Get Window_Handle of iObject to hWnd
//	  Send Windows_Message WM_ADDMESSAGE hWnd h__WinMessage
//	End_Procedure // External_Windows_Message
//	Procedure Register_Windows_Message
//	End_Procedure // Register_Windows_Message
//	Procedure Page Integer iState
//	  Forward Send Page iState
//	  if (iState=1) Send Register_Windows_Message
//	End_Procedure // Page
//	  function ContainerFocusWillNotChange returns integer //FWC 03/12/2004
//		  function_return 1
//	  end_function
//	  Procedure Rotate_Up //FWC 03/12/2004
//	  End_Procedure
//	  Procedure docreateanchors //FWC 03/12/2004
//	  End_procedure
//	  Procedure doapplyanchors //FWC 03/12/2004
//	  End_procedure
//End_Class // cWinMessage

Function FontArray Returns Handle
	Handle hArray
	Integer iIndex iStruct iLength iCount iVoid
	String sFont
	Get Create U_Array to hArray
	Move (FontEnumerate()) to iStruct
	Move 0 to iCount
	Move (MemCopy(AddressOf(iCount),iStruct,4)) to iVoid
	Add 8 to iStruct
	Decrement iCount
	Move 0 to iLength
	ZeroString 64 to sFont
	For iIndex From 0 to iCount
		Move (MemCopy(AddressOf(iLength),iStruct,4)) to iVoid
		Add 4 to iStruct
		Move (MemCopy(AddressOf(sFont),iStruct,iLength)) to iVoid
		Add iLength to iStruct
		Set Array_Value of hArray iIndex to sFont
	Loop
	Move (FontEnumerateFree(iStruct)) to iVoid
	Send Sort_Items to hArray
	Function_Return hArray
End_Function // FontArray

Procedure ChainWait Global String sProgram String sParameters
	Handle hObj hWnd
	Integer iVoid
	If (Uppercase(Right(sProgram,4))<>".EXE") Move (sProgram+".EXE") to sProgram
	Get Focus of Desktop to hObj
	If (hObj>desktop) Get Container_Handle of hObj To hWnd
	Else Move 0 to hWnd
	While (hWnd=0 AND hObj<>Desktop)
		Get Parent of hObj to hObj
		Get Container_Handle of hObj To hWnd
	Loop
	Move (ChainWait(hWnd,sProgram,sParameters)) to iVoid
End_Procedure // ChainWait

Type GRIDTOOLTIPSTRUCT //FWC 06/15/2006
	Field GRIDTOOLTIPSTRUCT.Hdr.hwndFrom as Integer
	Field GRIDTOOLTIPSTRUCT.Hdr.idFrom as Integer
	Field GRIDTOOLTIPSTRUCT.Hdr.Code as Integer
	Field GRIDTOOLTIPSTRUCT.iItem as Integer
	Field GRIDTOOLTIPSTRUCT.sMaskedValue As Char 80
End_Type // GRIDTOOLTIPSTRUCT

Class GridToolTip_Mixin is a Mixin //FWC 06/15/2006

	Procedure Define_GridToolTip_Mixin
		Property Handle Private.GridToolTipArray 0
	End_Procedure // Define_GridToolTip_Mixin

	Procedure Set Header_ToolTip Integer iItem String sToolTip
		Handle hArray
		Get Private.GridToolTipArray to hArray
		If (hArray=0) Begin
			Get Create U_Array to hArray
			Set Private.GridToolTipArray to hArray
		End
		Set Array_Value of hArray iItem to sToolTip
	End_Procedure // Header_ToolTip

	Function Header_ToolTip Integer iItem Returns String
		Handle hArray
		Get Private.GridToolTipArray to hArray
		If (hArray=0) Function_Return ""
		Function_Return (String_Value(hArray,iItem))
	End_Function // Header_ToolTip

	Procedure Reset_Header_Tooltips
		Handle hArray
		Get Private.GridToolTipArray to hArray
		If (hArray) Send Delete_Data to hArray
	End_Procedure // Reset_Header_Tooltips

	Procedure Notify Integer wParam Integer lParam
		String sGridNotify sValue
		Integer iVoid iItem iCode
		ZeroType GRIDTOOLTIPSTRUCT To sGridNotify
		Move (CopyMemory(AddressOf(sGridNotify), lParam, GRIDTOOLTIPSTRUCT_size)) To iVoid
		GetBuff From sGridNotify At GRIDTOOLTIPSTRUCT.Hdr.Code To iCode
		If (iCode = 101) Begin
			GetBuff From sGridNotify At GRIDTOOLTIPSTRUCT.iItem To iItem
			If (iItem>=0 And iItem<Line_Size(Self)) Begin
				Get Header_Tooltip iItem to sValue
				Move (Left(sValue,79)) to sValue
				Put_String sValue To sGridNotify At GRIDTOOLTIPSTRUCT.sMaskedValue
				Move (CopyMemory(lParam, AddressOf(sGridNotify), GRIDTOOLTIPSTRUCT_size)) To iVoid
			End
		End
		Else Forward Send Notify wParam lParam
	End_Procedure // Notify

	Procedure Page_Object Integer iState
		Forward Send Page_Object iSTate
		If (iState) Move (GridToolTip(Window_Handle(Self))) To iState
	End_Procedure // Page_Object

End_Class // GridToolTip_Mixin
